import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;

public class Circle implements IShape {
    Point ptCenter;
    int radius;

    public Circle(Point ptCenter, int radius) {
        this.ptCenter = ptCenter;
        this.radius = radius;
    }

    @Override
    public double perimeter() {
        return 2 * Math.PI * radius;
    }

    @Override
    public double area() {
        return Math.PI * radius * radius;
    }

    @Override
    public void draw(Graphics g) {
        Graphics2D g2d = (Graphics2D) g;
        Ellipse2D circle = new Ellipse2D.Double(ptCenter.x - radius, ptCenter.y - radius, radius * 2, radius * 2);
        g2d.draw(circle);
    }
}